
import{
  baseURL,
  timeOut
}from './config.js'



function request(options){
  console.log("请求接口：" + baseURL + options.url);
  wx.showLoading({
    title: '加载中...',
  })

  return new Promise((resolve, reject)=>{
    wx.request({
      url: baseURL + options.url,
      method:options.method,
      data:options.data,

      success:function(res){
        console.log('👇👇👇👇👇👇以下是请求参数👇👇👇👇👇👇');
        console.log(options.data),
        resolve(res.data),
        console.log(res)
      },
      fail:reject,
      complete:res=>{
        wx.hideLoading()
      },
    })
  }

  )
}

export default request